﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Presenter_SSResourceManager;

namespace WebView_SSResourceManager.UserPages
{
    public partial class DeleteForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            PresenterDelete _presenter = new PresenterDelete();
            var id = GetQueueId();
            _presenter.Delete(id);
            Response.Redirect("../UserPages/MyQueuesView.aspx");
        }

        public Guid GetQueueId()
        {
            var query = HttpContext.Current.Request.Url.Query.Where(symbol => symbol != '?');
            return Guid.Parse(new string(query.ToArray()));
        }
    }
}